package practice;

public class 数字加密和解密 {
    public static void main(String[] args) {
        int arr[] = {1,9,8,3};
        for (int i = 0; i < arr.length; i++) {
            arr[i] = (arr[i] + 5) % 10;
        }
        for (int i = 0,j = arr.length - 1; i < j; i++,j--) {
            int tpey = arr[i];
            arr[i] = arr[j];
            arr[j] = tpey;
        }
        int number =0;
        for (int i = 0; i < arr.length; i++) {
            number = number * 10 + arr[i];
        }
        System.out.println(number);

        int temp = number;
        int count = 0;
        while(number != 0){
            number = number / 10;
            count++;

        }

        int cot= 0;
        int arr2[] = new int[count];
        while(temp != 0){
            int ge = temp % 10;
            temp = temp / 10;
            arr2[cot] = ge;
            cot++;
        }
        for (int i = 0; i < arr2.length; i++) {
            System.out.print(arr2[i]);
        }

    }

}
